package com.arron.algorithm.leetcodetop100.二叉树;

import com.arron.algorithm.tree.TreeNode;
import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;

/**
 * leetcode 104. 二叉树的最大深度
 */
public class TreeMaxDepth {


    public int maxDepth(TreeNode root) {
        if (root == null){
            return 0;
        }
        int leftH= maxDepth(root.left)+1;
        int rightH = maxDepth(root.right)+1;
        return Math.max(leftH,rightH);
    }


}
